﻿using Microsoft.Extensions.DependencyInjection;
using StartsEAS_API.BLL.Interfaces;
using StartsEAS_API.DAL;
using StartsEAS_API.Model;
using StartsEAS_API.Model.Models;
using System;
using System.Collections.Generic;

namespace StartsEAS_API.BLL
{
    public class LoginBLL : ILoginBLL
    {
        private readonly StarsEASContext _context;
        public LoginDAL _loginDal;
        public LoginBLL(IServiceScopeFactory context) {
            _context = context.CreateScope().ServiceProvider.GetRequiredService<StarsEASContext>();
            _loginDal =  new(_context);
        }
        
        public ResultUtils GetStudent(string username, string pwd)
        {
            return _loginDal.GetStudent(username, pwd);
        }
        public ResultUtils GetTeacher(string username, string pwd) {
            return _loginDal.GetTeacher(username, pwd);
        }
    }
}
